package org.shiwen.week5;

public class Average {
    //方法重载只在意参数的类型和长度有无区别，如果参数类型和长度一致，则报错
    public static double average(int a,int b)
    {
        return (a+b)/2;
    }

    public static int average(int a,int b,int c)
    {
        return (a+b+c)/3;
    }

    public static double average(double a,double b)
    {
        return (a+b)/2;
    }



    public static void main(String[] args) {
        System.out.println(average(1,2));
        System.out.println(average(1,2,3));
        System.out.println(average(1.0,2.0));
    }
}
